package de.gympu.gympulan.gplserver.chatserver;

public class ChatServerParser {
	private ChatServerConnection controler;
	public ChatServerParser(ChatServerConnection controler) {
		this.controler = controler;
	}
	
	public void parse(String[] data) {
		try {
			if(data[0].equals("100")) {
				controler.sendMessage(data[1]);
			}
			
			if(data[0].equals("200")) {
				controler.setName(data[1]);
			}
		}
		catch(NumberFormatException e) {
			;
		}
		catch(ArrayIndexOutOfBoundsException e) {
			;
		}
	}
}
